def main(argv):
- (opts, config) = parseCommandLine(argv)
+ try:
+ (opts, config) = parseCommandLine(argv)
+ except StandardError, ex:
+ err(str(ex))
if not opts:
return
dom0_min_mem = xroot.get_dom0_min_mem()
if dom0_min_mem != 0:
if balloon_out(dom0_min_mem, opts):
- print >>sys.stderr, "error: cannot allocate enough memory for domain"
- sys.exit(1)
+ err("cannot allocate enough memory for domain")
dom = make_domain(opts, config)
if opts.vals.console_autoconnect:
"""Execute the check and set the variable to the new value.
"""
if not self.check: return
- env[self.name] = self.check(self.name, env.get(self.name))
+ try:
+ env[self.name] = self.check(self.name, env.get(self.name))
+ except StandardError, ex:
+ raise sys.exc_type, self.name + " - " + str(ex)
def doHelp(self, out):
"""Print help for the variable.